<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="java.util.Map" %>
<%@page import="java.util.List" %>
<%@page import="java.util.Iterator" %>
<div class="path">
    <span>Registrar-se</span>
</div>
<div id="page">
    <div id="missatge"></div>
    <form action="usuaris" id="registrar" method="post">
        <input name="op" value="3" type="hidden" />
        <div style="color: #cc0000;">Totes les dades són neccesaries</div>
        <div>
            <label for="rNom">Nom:</label>
            <input type="text" value="" id="rNom" name="nom" tabindex="1" maxlength="50" class="required" />
            <label for="rCog">Cognoms:</label>
            <input type="text" value="" id="rCog" name="cognoms" tabindex="2" maxlength="100" class="required" />
            <label for="rDia">Data de naixement:</label>
            <select id="rDia" name="dia" class="number"  tabindex="3">
                <% for(int i=1; i <= 31; i++) { %>
                <option value="<%=i %>"><%=i %></option>
                <% } %>
            </select>
            <select id="rMes" name="mes" class="number" tabindex="4">
                <% for(int i=1; i <= 12; i++) { %>
                <option value="<%=i %>"><%=i %></option>
                <% } %>
            </select>
            <select id="rAny" name="any" class="number" tabindex="5">
                <% for(int i=2000; i > 1920; i--) { %>
                <option value="<%=i %>"><%=i %></option>
                <% } %>
            </select>
        </div>
        <div>
            <label for="rAdr">Adre&ccedil;a:</label>
            <input type="text" value="" id="rAdr" name="adreca" tabindex="6" maxlength="100" class="required" />
            <label for="rCp">Codi postal:</label>
            <input type="text" value="" id="rCp" name="cp" tabindex="7" maxlength="5" class="required number" /><br />
            <label for="rProb">Poblaci&oacute;:</label>
            <input type="text" value="" id="rPob" name="poblacio" tabindex="8" maxlength="100" class="required" />
            <label for="rPa">Pa&iacute;s:</label>
            <select id="rPa" name="pais" class="number">
                <option value="cap" selected="selected">Sel·leciona el teu pais</option>
                <%
                Iterator<Map<String,Object>> it = ((List<Map<String,Object>>) request.getAttribute("paisos")).iterator();
                Map<String,Object> dada;
                while(it.hasNext()) {
                    dada = it.next();
                %>
                <option value="<%=dada.get("id_pais") %>"><%=dada.get("nom_pais") %></option>
                <% } %>
            </select>
        </div>
        <div>
            <label for="rTel">Telefon:</label>
            <input type="text" value="" name="telefon" id="rTel" tabindex="9" maxlength="15" class="required number" />
            <label for="rBanc">Conta bancaria:</label>
            <input type="text" value="" id="rBanc" name="banc" maxlength="4" tabindex="10" class="required number" />
            <input type="text" value="" id="rOfi" name="oficina" maxlength="4" tabindex="11" class="required number" />
            <input type="text" value="" id="rDC" name="dc" maxlength="2" tabindex="12" class="required number" />
            <input type="text" value="" id="rCC" name="cc" maxlength="10" tabindex="13" class="required number" />
        </div>
        <div>
            <label for="rMail">Correu Electronic:</label>
            <input type="text" value="" name="email" id="rMail" tabindex="14" maxlength="50" class="required email" />
            <label for="rMail">Repetir Correu Electronic:</label>
            <input type="text" value="" name="email2" id="rMail2" tabindex="15" maxlength="50" class="required email" />
        </div>
        <div>
            <label for="rPas">Password:</label>
            <input type="password" value="" id="rPas" name="password" maxlength="20" tabindex="16" class="required"/>
            <label for="rPas2">Repetir password:</label>
            <input type="password" value="" id="rPas2" name="password2" maxlength="20" tabindex="17" class="required" />
        </div>
        <div class="botons">
            <input type="submit" value="Registar-se" class="boto" />
            <input type="reset" value="Borrar dades" class="boto" />
        </div>
    </form>
</div>